<%@ page import="com.ccjq.shosestore.order.bo.OrderBo" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%--变量区--%>
<c:set var="ctx" value="${pageContext.request.contextPath}" scope="page"/>
<%!String type = ""; %>
<%--变量区结束--%>

<%--判断支付类型区域--%>
<%
    OrderBo ob = (OrderBo) request.getAttribute( "orderBo" );
    int temp = ob.getPayment();
    if (temp == 1) {
        type = "支付宝";
    } else {
        type = "微信";
    }
%>
<%--判断支付类型区域结束--%>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>

    <link rel="stylesheet" href="${ctx}/css/templatemo_style.css"/>
    <!-- 页面整体布局样式定义 -->
    <link rel="stylesheet" href="${ctx}/css/ddsmoothmenu.css"/>
    <!-- 菜单样式定义 -->
    <link rel="stylesheet" href="${ctx}/css/nivo-slider.css" media="screen"/>
    <!-- 焦点图样式定义 -->
    <script type="text/javascript" src="${ctx}/js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript"
            src="${ctx}/js/jquery.nivo.slider.pack.js"></script>
    <!-- 焦点图JS脚本定义 -->

    <title>订单详细信息</title>
	<!--辅助脚本区域-->
	<script>
	    function showUserName() {
	        var name = "${user.username}";
	        if(name != ""){
	            $("#login").html(name);
	            $("#exitP").show();
	            $("#login").attr("href", "${ctx}/UserServlet?flag=info&userId=${user.userId}");
	        }else{
	            $("#exitP").hide();
	        }
	    }
	</script>
	<!--辅助脚本区域结束-->
</head>
<body>
<div id='templatemo_body_wrapper'>
    <div id="templatemo_wrapper">

        <%--网页头部--%>
        <div id="templatemo_header">
            <div id="site_title">
                <h1>
                    <a href="#">穿美在线鞋城</a>
                </h1>
            </div>
            <div id="header_right">
                <p>
                    <a href="${ctx}/UserServlet?flag=login" id="login" target="_blank">登陆</a>&nbsp;
                    <span id="exitP" style="display: none"><a href="${ctx}/UserServlet?flag=logout" id="exit" target="_blank">注销</a></span>
                </p>
            </div>
            <div class="cleaner"></div>
        </div>
        <%--网页头部结束--%>


        <!-- 导航栏 -->
        <div id="templatemo_menubar">
            <div id="top_nav" class="ddsmoothmenu">
                <ul>
                    <li><a href="${ctx}/pro?flag=index" >首页</a></li>
                    <li><a href="${ctx}/pro?flag=product">产品</a></li>
                    <li><a href="${ctx}/ShoppingCartServlet">我的购物车</a></li>
                    <li><a href="${ctx}/OrderServlet?flag=qoi" class="selected">我的订单</a></li>
                </ul>
                <br style="clear: left"/>
            </div>
            <!-- end of ddsmoothmenu -->
        </div>
        <!-- 导航栏结束 -->

       <%--订单详细信息展示区--%>
        <div id="templatemo_main">
            <div align="center">
                <span style="margin-left: 100px"><h3>订单详情</h3><br></span>
            </div>

            <br/>
            <div style="margin-left: 100px">
                <h4>订单</h4>
                &nbsp;&nbsp;&nbsp;&nbsp;订单号：${orderBo.orderId}<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;创建时间：${orderBo.createTime}<br/>
                &nbsp;<h4>付款信息</h4>
                &nbsp;&nbsp;&nbsp;&nbsp;支付类型：<%=type%><br/>
                &nbsp;&nbsp;&nbsp;&nbsp;总价：${orderBo.amout}<br/>
                &nbsp;<h4>收货人信息</h4>
                &nbsp;&nbsp;&nbsp;&nbsp;收货人：${orderBo.receiver}<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;省份：${orderBo.province}<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;城市：${orderBo.city}<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;区县：${orderBo.county}<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;地址：${orderBo.address}<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;邮政编码：${orderBo.zipcode}<br/>
                &nbsp;&nbsp;&nbsp;&nbsp;联系电话：${orderBo.telphone}<br/>
                <hr style="margin-left: -100px">
                <%--订单中的商品信息--%>
                <table border="0" cellspacing="0">
                    <tr align="center">
                        <td width="120"><b>商品编号</b></td>
                        <td width="300"><b>商品描述</b></td>
                        <td width="120"><b>数量</b></td>
                        <td width="120"><b>价格</b></td>
                        <td width="120"><b>小计</b></td>
                    </tr>

                    <c:forEach var="temp" items="${orderBo.shopInfo}">
                        <tr align="center">
                            <td><c:out value="${temp.produceId}"/></td>
                            <td><c:out value="${temp.descripyion}"/></td>
                            <td><c:out value="${temp.quantity}"/></td>
                            <td><c:out value="￥${temp.price}"/></td>
                            <td><c:out value="￥${temp.subtotal}"/></td>
                        </tr>
                    </c:forEach>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr align="center">
                        <td></td>
                        <td></td>
                        <td></td>
                        <td><b>总金额</b></td>
                        <td>￥${orderBo.amout}</td>
                    </tr>
                </table>
            </div>
            <br/>
            <div align="center" style="margin-left: 100px">
                <span style=" margin-right: 100px" >
                    <a href="${ctx}/OrderServlet?flag=qoi">返回订单列表</a>
                </span>
            </div>
            <br/>
        </div>
        <%--订单详细信息展示区结束--%>

        <!-- footer -->
        <div id="templatemo_footer">
            <p>
                <a href="${ctx}/pro?flag=index">首页</a> | <a
						href="${ctx}/pro?flag=product">产品</a> | <a
						href="${ctx}/ShoppingCartServlet">我的购物车</a> | <a
						href="${ctx}/OrderServlet?flag=qoi">我的订单</a>
            </p>
            版权所有 (c) 2018 <a href="javascript:void(0);">金桥软件</a>
        </div>
        <!-- END of templatemo_footer -->
    </div>
</div>
<script type="text/javascript">
    $(function() {
        $('#slider').nivoSlider();
        showUserName();
    });
</script>
</body>
</html>